import React, {Component} from 'react'
import ManagementFrame from '../common/managementFrame'
import UserManagement from './userManagement'
import RoleManagement from './roleManagement'
import UnitManagement from './unitManagement'
import LogManagement from './logManagement'

class SystemApp extends Component {
    state = {
        routeList: [
            {name: 'userManagement', component: UserManagement},
            {name: 'roleManagement', component: RoleManagement},
            {name: 'unitManagement', component: UnitManagement},
            {name: 'logManagement', component: LogManagement}
        ],
        navList: [
            {name: '用户管理', path: 'userManagement'},
            {name: '角色管理', path: 'roleManagement'},
            {name: '单位管理', path: 'unitManagement'},
            {name: '日志管理', path: 'logManagement'}
        ]
    }

    render() {
        const {routeList, navList} = this.state;
        const managementFrameProps = {
            ...this.props,
            name: '系统中心',
            type: 'system',
            navList,
            routeList,
            defaultPath:'budgetManagement'
        }
        return (
            <>
                <ManagementFrame {...managementFrameProps}/>
            </>
        )
    }
}

export default SystemApp;